<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--解决闪烁问题-->
    <style>
        [v-clock]{
            display: none;
        }
    </style>
</head>
<body>

<!--view层 模板-->
<div id="app" v-clock>

    <div>{{info.name}}</div>
    <div>{{info.address.street}}</div>
    <div>{{info.links[0].name}}</div>

    <a :href="info.url">点我</a>

</div>

<!--第一步，导入Vue.js-->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<!--导入axios包-->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>


    var vm = new Vue({
        el:"#app",
        //Model:数据
        data:{

        },
        methods: {

        },
        data(){
            return{
                //请求的返回参数格式，必须和json字符串一样
                info:{
                    name: null,
                    adddress: {
                        street: null,
                        city: null,
                        country: null
                    },
                    url: null,
                    links: null
                }
            }
        },
        mounted(){//钩子函数,链式编程  ES6新特性
            axios.get('../data.json').then(response=>(this.info=response.data));
        }
    });
</script>
</body>
</html>